﻿<UserControl x:Class="StockholmsStad.Windows.UI.Controls.MonthCalendarControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:DateControls="clr-namespace:Microsoft.Samples.KMoore.WPFSamples.DateControls;assembly=J832.Wpf.BagOTricksLib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Converters="clr-namespace:StockholmsStad.Windows.UI.Infrastructure.Converters;assembly=StockholmsStad.Windows.UI.Infrastructure">
    <UserControl.Resources>
        <Converters:DateTimeToDateString x:Key="DateConverter" />
        <Style x:Key="CalendarTitleStyle" TargetType="{x:Type DateControls:MonthCalendarTitle}">
            <Setter Property="Background" Value="LightGray"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="FontWeight" Value="Bold"/>
            <Setter Property="Padding" Value="8"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="false">
                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </UserControl.Resources>

    <StackPanel Orientation="Horizontal">

        <StackPanel Orientation="Vertical" Width="130" Margin="5,0,5,0">
            <TextBlock TextWrapping="Wrap" Margin="0,0,0,5">
                        <Run Text="Välj en tid genom att klicka på aktuellt datum i listan till höger." />
            </TextBlock>

            <TextBox IsReadOnly="True" Height="24" VerticalAlignment="Top" Width="100" HorizontalAlignment="Left"
                             Text="{Binding ElementName=monthCalendar, Path=SelectedDate, Converter={StaticResource DateConverter}}" />

        </StackPanel>

        <DateControls:MonthCalendar x:Name="monthCalendar" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="2" Grid.Row="1"
                                   FirstDayOfWeek="Monday" TitleStyle="{StaticResource CalendarTitleStyle}" Language="sv-SE">
        </DateControls:MonthCalendar>

    </StackPanel>

</UserControl>
